<h1>Edita contratto</h1>

<%= error_messages_for :contract %>

<% form_for(@contract) do |f| %>
  <div id="campi">
    <p><label for="code">Codice: </label><br /><%= f.text_field :code %></p>
    <p><label for="contract_expiration">Data scadenza: </label><br />
		<%= calendar_date_select_tag "contract[expiration]", @contract.expiration, :time => false %></p>

		<%= render :partial => 'services' %>
		
	  <p><label for="contract_notes">Note: </label><br /><%= f.text_area :notes, :size => "40x6" %></p>
		<br />
    <%= f.submit "Update" %>
  </div>
<% end %>

<%= link_to 'Show', @contract %> |
<%= link_to 'Back', :back %>

<div id="add_service" style="display:none">
	<% form_remote_tag :url => {:controller => 'services', :action => 'create'},
	    :html => {:id => 'service_form'} do %>
		<p><label for="service_description">Descrizione: </label><br />
			<input id="service_description" name="service[description]" size="30" type="text" /></p>
		<br />
    <input id="service_submit" name="commit" type="submit" value="Crea servizio" />
	<% end %>
</div>